<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var total = 17;
        //30
        //8`8`1
        var sum = 0
        for(var i = 0;i<17;i+=8){
            sum+= 10;//sum=1
        }
        //i=0   sum=10
        /* 
            1=0;sum=10
            i=8;sum=20;
            i=16;sum=30;
            i=24
        */
        console.log(sum)

        // sum(){
            var sum = 0
            for(var i=0;i<this.total;i+=8){
                sum+=10;
            }
            return sum;
            console.log(sum)
        // }
    </script>
</body>
</html>